package com.zut.controller;


import com.zut.exception.BusinessException;
import com.zut.exception.SystemException;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class ProjectExceptionAdvice {
    @ExceptionHandler(SystemException.class)
    public Result doSystemException(SystemException ex){
        return new Result(ex.getCode(),null,ex.getMessage());
    }
    @ExceptionHandler(BusinessException.class)
    public Result doBusinessException(SystemException ex){
        return new Result(ex.getCode(),null,ex.getMessage());
    }




    @ExceptionHandler(Exception.class)
    public Result doException(Exception ex){
        return new Result(000,null,"系统异常");
    }

}


